<?php
header("content-type:text/html;charset=utf-8");
require("config.php");												//包含数据库连接文件
$select_sql = "SELECT * FROM depart";
$result = mysql_query($select_sql);
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>员工管理</title>
  <meta name="description" content="mobile first, app, web app, responsive, admin dashboard, flat, flat ui">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">	
  <link rel="stylesheet" href="css/bootstrap.css">
  <link rel="stylesheet" href="css/font-awesome.min.css">
  <link rel="stylesheet" href="css/style.css">
  <link rel="stylesheet" href="css/plugin.css">
  <link rel="stylesheet" href="css/landing.css">
  <!--[if lt IE 9]>
    <script src="js/ie/respond.min.js"></script>
    <script src="js/ie/html5.js"></script>
  <![endif]-->
</head>
<body>
   <!-- header -->
	<header id="header" class="navbar">
    <ul class="nav navbar-nav navbar-avatar pull-right">
      <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">            
          <span class="hidden-sm-only"></span>
          <span class="thumb-small avatar inline"><img src="images/avatar.jpg" alt="" class="img-circle"></span>
          <b class="caret hidden-sm-only"></b>
        </a>
        <ul class="dropdown-menu">
          <li class="icon-gear"><span class="text"><a href="#">设置</a></span></li>
          <li class="divider"></li>
          <li class="icon-signout"><span class="text"><a href="signin.html">注销</a></span></li>
        </ul>
      </li>
    </ul>
    <a class="navbar-brand" href="#">管理</a>
    <button type="button" class="btn btn-link pull-left nav-toggle hidden-lg" data-toggle="class:slide-nav slide-nav-left" data-target="body">
      <i class="icon-reorder icon-xlarge text-default"></i>
    </button>
    <ul class="nav navbar-nav hidden-sm">
      <li class="dropdown shift" data-toggle="shift:appendTo" data-target=".nav-primary .nav">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-cog icon-xlarge visible-sm visible-sm-inline"></i>设置<b class="caret hidden-sm-only"></b></a>
        <ul class="dropdown-menu">
          <li>
            <a href="#" data-toggle="class:navbar-fixed" data-target='body'> 
              <span class="text-active">自动</span>
              <span class="text">固定</span>
            </a>
          </li>
          <li class="visible-lg">
            <a href="#" data-toggle="class:nav-vertical" data-target="#nav"> 
              <span class="text-active">垂直</span>
              <span class="text">水平</span>
            </a>
          </li>
          <li class="divider hidden-sm"></li>
          <li class="dropdown-header">颜色</li>
          <li>
            <a href="#" data-toggle="class:bg bg-black" data-target='.navbar'>上： 
              <span class="text-active">白色</span>
              <span class="text">黑色</span>
            </a>
          </li>
          <li>
            <a href="#" data-toggle="class:bg-light" data-target='#nav'>左： 
              <span class="text-active">暗</span>
              <span class="text">亮</span>
            </a>
          </li>
        </ul>
      </li>
    </ul>
	</header>
  <!-- / header -->
  <!-- nav -->
  <nav id="nav" class="nav-primary visible-lg nav-vertical">
    <ul class="nav" data-spy="affix" data-offset-top="50">
      <li class="active"><a href="depart.php"><i class="icon-group icon-xlarge"></i>部门</a></li>
      <li class="dropdown-submenu">
        <a href="users.php"><i class="icon-male icon-xlarge"></i>员工</a>
      </li>
      <li><a href="jiaban.php"><i class="icon-edit icon-xlarge"></i>加班信息</a></li>
      <li class="dropdown-submenu">
        <a href="#"><i class="icon-link icon-xlarge"></i>其他</a>
        <ul class="dropdown-menu">
          <li><a href="signin.html">登录</a></li>
          <li><a href="sign_up.php">注册</a></li>
          <li><a href="404.html">关于我们</a></li>
        </ul>
      </li>
    </ul>
  </nav>
    <section id="content">
    <section class="main padder">
      <div class="clearfix">
        <h4><i class="icon-group"></i>部门信息</h4>
      </div>
      <div class="row">
          <div class="panel">
            <div class="clearfix">
			<div  class="col-md-8" align="center" >
			<table  class="table table-striped table-condensed">
				<tr>
					<th>ID</th>
					<th>部门名称</th>
					<th>管理</th>
				</tr>
				<?php
					while($row = mysql_fetch_array($result))
					{
				?>
				<tr>
					<td><?php echo $row['d_id'];?></td>
					<td><?php echo $row['d_name']?></td>	
					<td>
						<a href="update2.php?id=<?php echo $row['d_id']?>">修改</a>
					</br>
						<a href="delete2.php?id=<?php echo $row['d_id']?>">删除</a>
					</br>
						<a href="add_depart.html?id=<?php echo $row['d_id']?>">新增</a>
					</br>
					</td>
				<?php }?>	
				</tr>
			</table>
			</div>
		</div>
	</div>
	</div>
  </section>
  </section>
  <!-- footer -->
  <footer id="footer">
    <div class="text-center padder clearfix">
      <p>
        <small>&copy;山东舜网传媒股份有限公司</small><br><br>
      </p>
    </div>
  </footer>
  <!-- / footer -->
	<script src="js/jquery.min.js"></script>
  <!-- Bootstrap -->
  <script src="js/bootstrap.js"></script>
  <!-- app -->
  <script src="js/app.js"></script>
  <script src="js/app.plugin.js"></script>
  <script src="js/app.data.js"></script>
  <!-- fuelux -->
  <script src="js/fuelux/fuelux.js"></script>
  <!-- datepicker -->
  <script src="js/datepicker/bootstrap-datepicker.js"></script>
  <!-- slider -->
  <script src="js/slider/bootstrap-slider.js"></script>
  <!-- file input -->  
  <script src="js/file-input/bootstrap.file-input.js"></script>
  <!-- combodate -->
  <script src="js/combodate/moment.min.js"></script>
  <script src="js/combodate/combodate.js"></script>
  <!-- parsley -->
  <script src="js/parsley/parsley.min.js"></script>
</body>
</html>